LIB_SRC_PATH = ../../../..
ifeq ($(__CONFIG_USE_PREBUILT_LIBSC_ASSISTANT), y)
BUILD_SC_ASSISTANT := n
else
BUILD_SC_ASSISTANT := y
endif

ifeq ($(__CONFIG_USE_PREBUILT_LIBWPA), y)
BUILD_WPA := n
else
BUILD_WPA := y
endif

ifeq ($(__CONFIG_USE_PREBUILT_LIBWPAS), y)
BUILD_WPAS := n
else
BUILD_WPAS := y
endif

ifeq ($(__CONFIG_USE_PREBUILT_LIBWLAN), y)
BUILD_WLAN := n
else
BUILD_WLAN := y
endif

ifeq ($(__CONFIG_USE_PREBUILT_LIBXRWIRELESS), y)
BUILD_XRWIRELESS := n
else
BUILD_XRWIRELESS := y
endif

ifeq ($(__CONFIG_USE_PREBUILT_LIBNET80211), y)
BUILD_NET80211 := n
else
BUILD_NET80211 := y
endif


GLOBAL_INCLUDES += drivers/include/net \
                   $(LIB_SRC_PATH)/wlan/src/net \
                   $(LIB_SRC_PATH)/wlan/include \
                   $(LIB_SRC_PATH)/wlan/include/net

GLOBAL_INCLUDES += $(LIB_SRC_PATH)/wlan/src/net/wpa_supplicant-2.4/src/utils \
                   $(LIB_SRC_PATH)/wlan/src/net/wpa_supplicant-2.4/src


ifeq ($(BUILD_WPA), y)
__CONFIG_WLAN_STA := y
__CONFIG_WLAN_AP := n
__CONFIG_WLAN_STA_WPS := n
endif

ifeq ($(BUILD_WPAS), y)
__CONFIG_WLAN_STA := y
__CONFIG_WLAN_AP := n
__CONFIG_WLAN_STA_WPS := n
endif

ifeq ($(BUILD_XRWIRELESS), y)
GLOBAL_CFLAGS   += -D__CONFIG_CHIP_XRADIO
endif

GLOBAL_CFLAGS   += -D__CONFIG_WLAN_SMALL_STACK_SIZE


ifeq ($(__CONFIG_WLAN_AP), y)
GLOBAL_CFLAGS   += -D__CONFIG_WLAN_AP
endif

ifeq ($(__CONFIG_WLAN_STA_WPS), y)
GLOBAL_CFLAGS   += -D__CONFIG_WLAN_STA_WPS
endif

# CFLAGS
GLOBAL_CFLAGS += -DCONFIG_BACKEND_XRADIO
GLOBAL_CFLAGS += -DCONFIG_DRIVER_XRADIO
GLOBAL_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
GLOBAL_CFLAGS += -DCONFIG_NO_RANDOM_POOL
GLOBAL_CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
GLOBAL_CFLAGS += -DCONFIG_NO_ROAMING
GLOBAL_CFLAGS += -DCONFIG_NO_RADIUS
GLOBAL_CFLAGS += -DCONFIG_NO_ACCOUNTING
GLOBAL_CFLAGS += -DCONFIG_NO_VLAN
GLOBAL_CFLAGS += -DCONFIG_NO_CTRL_IFACE

ifeq ($(__CONFIG_WLAN_STA), y)
#GLOBAL_CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
#GLOBAL_CFLAGS += -DCONFIG_NO_ROAMING
ifeq ($(__CONFIG_WLAN_STA_WPS), y)
GLOBAL_CFLAGS += -DCONFIG_WPS
GLOBAL_CFLAGS += -DEAP_WSC
GLOBAL_CFLAGS += -DIEEE8021X_EAPOL
GLOBAL_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
GLOBAL_CFLAGS += -DCONFIG_SHA256
endif
endif

ifeq ($(__CONFIG_WLAN_AP), y)
GLOBAL_CFLAGS += -DHOSTAPD
#GLOBAL_CFLAGS += -DCONFIG_NO_RADIUS
#GLOBAL_CFLAGS += -DCONFIG_NO_ACCOUNTING
#GLOBAL_CFLAGS += -DCONFIG_NO_VLAN
#GLOBAL_CFLAGS += -DCONFIG_NO_CTRL_IFACE
#GLOBAL_CFLAGS += -DCONFIG_CTRL_IFACE
#GLOBAL_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
#GLOBAL_CFLAGS += -DEAP_SERVER_IDENTITY # original from hostapd, but it seems useless
endif
